]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog: Also center the time in 12h format
authorpesader <pedro.saderazevedo@pm.me>
Sun, 28 Apr 2024 20:40:59 +0000 (17:40 -0300)
committerpesader <pedro.saderazevedo@pm.me>
Sun, 28 Apr 2024 21:20:32 +0000 (18:20 -0300)
Since the time string uses a space to pad single-digit numbers, the
centered label looks off-center. Fix this by applying the trim()
function to get rid of whitespaces.

The drawback of this approach is that the label will change position
slightly when the time changes, but for the lockscreen that's okay.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6193
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3290>

js/ui/unlockDialog.js

index 15a3a984eed5208c5a748fcd5b4476809cbc0d81..7b2ab8d38df47a28619558cd41843e9836810ebb 100644 (file)
@@ -366,7 +366,7 @@ class UnlockDialogClock extends St.BoxLayout {
     }
 
     _updateClock() {
-        this._time.text = this._wallClock.clock;
+        this._time.text = this._wallClock.clock.trim();
 
         let date = new Date();
         /* Translators: This is a time format for a date in